<!-- 商品内容 -->
<div id="content-tab" class="tab-content p-6">
    <div id="goods-content-area">
        <!-- 商品简介 - 始终显示 -->
        <div class="goods-description mb-6">
            <div class="prose max-w-none text-gray-500 leading-relaxed">
                {$goods.content|raw}
            </div>
        </div>

        <!-- 商品标签 -->
        {if $goods.tags && count($goods.tags) > 0}
        <div class="mb-8">
            <div class="flex items-center flex-wrap gap-2 text-sm text-gray-500">
                <i class="fas fa-tags mr-2 text-gray-400"></i>
                {volist name="goods.tags" id="tag" key="k"}
                <a href="/tag/{$tag.id|default=$tag.tag_id}" target="_blank"
                    class="text-blue-600 hover:text-blue-800 hover:underline transition-colors">
                    {$tag.name|default=$tag}
                </a>
                {if $k < count($goods.tags)}<span class="text-gray-300">•</span>{/if}
                    {/volist}
            </div>
        </div>
        {/if}
        <!-- 付费内容区域 -->
        {if $goods.paid_content_type && !in_array($goods.paid_content_type, ['multi_chapter', 'chapter_groups',
        'multi_file'])}
        <!-- 非章节类型的付费内容直接显示 -->
        <div class="paid-content-area">
            <div class="  pt-8">

                {if $goods.has_paid || $goods.is_free}
                <!-- 已购买或免费，显示完整付费内容 -->
                <div class="paid-content-full">
                    {switch name="goods.paid_content_type"}
                    {case value="text"}
                    <!-- 图文内容 -->
                    <div class="prose max-w-none text-gray-500 leading-relaxed">
                        {$goods.paid_content.content|raw}
                    </div>
                    {/case}

                    {case value="multi_chapter"}
                    <!-- 多章节 -->
                    <div class="space-y-6">
                        {if $goods.paid_content.chapters}
                        {volist name="goods.paid_content.chapters" id="chapter"}
                        <div class="border rounded-sm p-6 bg-white">
                            <h4 class="text-lg font-semibold text-gray-800 mb-4">{$chapter.title}</h4>
                            <div class="prose max-w-none text-gray-500">
                                {$chapter.content|raw}
                            </div>
                            {if $chapter.is_free == 0 && !$goods.has_paid}
                            <div class="mt-4 p-4 bg-yellow-50 border border-yellow-200 rounded">
                                <p class="text-yellow-800 text-sm">此章节需要购买后查看</p>
                            </div>
                            {/if}
                        </div>
                        {/volist}
                        {/if}
                    </div>
                    {/case}

                    {case value="file"}
                    <!-- 单文件下载 -->
                    <div class="file-content">
                        <div class="flex items-center p-4 border rounded-sm border-gray-200">
                            <i class="fas fa-file-download text-2xl text-blue-500 mr-4"></i>
                            <div class="flex-1">
                                <h4 class="font-medium text-gray-800">{$goods.paid_content.title|default='下载文件'}</h4>
                                <p class="text-sm text-gray-500">{$goods.paid_content.description|default='点击下载付费文件'}
                                </p>
                                {if $goods.paid_content.file_size}
                                <p class="text-xs text-gray-500">文件大小: {$goods.paid_content.file_size|format_file_size}
                                </p>
                                {/if}
                            </div>
                            <a href="{$goods.paid_content.file_url}" download
                                class="px-4 py-2 bg-blue-500 text-white rounded-sm hover:bg-blue-600 transition-colors">
                                <i class="fas fa-download mr-2"></i>下载
                            </a>
                        </div>
                    </div>
                    {/case}

                    {default /}
                    {/switch}
                </div>
                {else}
                <!-- 未购买，显示购买提示 -->
                {include file="default/goods/detail/components/purchase_prompt" /}
                {/if}
            </div>
        </div>
        {/if}
    </div>
</div>